 
<script src="<?php echo base_url(); ?>../assets/modules/metronic/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
<script> 
        var nomor, md5, a, j, panggilke; 
        function RealTime(){
        var play =  document.getElementById("play");
            $.ajax({
                url:"<?php  echo base_url("dashboard/antrian")?>",
                dataType : "json",
                success: function(response){
					setTimeout("RealTime()",2000);
                    if (nomor != response.nomor || panggilke != response.panggilke){
                        $("#nomor_antrian").html(response.nomor);
                        if (response.spel != ""){
                            a = response.spel.split(" ");
                            j = 0;
                            console.log(j);
                            play.src = "<?php echo base_url(); ?>dashboard/suara/"+a[j];
                            play.play();
                            play.onended  = function(){
                                    j++;
                                if (j < a.length){
                                    play.src = "<?php echo base_url(); ?>dashboard/suara/"+a[j];
                                    play.play();
                                }
                            }
                        }
                    }
                    if (md5 != response.md5){
                        $("#list_antrian").html("");
                        for(i=0;i<response.list.length;i++){
                            $("#list_antrian").append("<tr><td>"+response.list[i].pengunjung_nomor+"</td></tr>");
                        }
                    }
                    
                    
                    nomor = response.nomor ;
                    md5 = response.md5 ;
                    panggilke = response.panggilke ;
                }
            });
        }
        RealTime();
     //   setInterval("RealTime()",10000);
</script>
<?php echo $html; ?>
<audio id="play" autoplay autobuffer ></audio>